package com.hyfd.controller.mp;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hyfd.controller.sys.BaseController;
import com.hyfd.service.mp.DataChargeSer;
import com.hyfd.service.mp.PhoneSectionSer;


@Controller
public class DataChargeCtl extends BaseController{

	@Autowired 
	private PhoneSectionSer phoneSectionSer;
	@Autowired 
	private DataChargeSer dataChargeSer;
	
	/**
	 * 跳转到流量单号充值页面 使用get方式提交
	 * @param req
	 * @return
	 */
	@GetMapping("dataSingleRechargePage")
	public String dataSingleRechargePage() {
		return "mp/dataSingleRecharge";
	}
	
	/**
	 * 跳转到流量批号充值页面 使用get方式提交
	 * @param req
	 * @return
	 */
	@GetMapping("dataBatchRechargePage")
	public String dataBatchRechargePage() {
		return "mp/dataBatchRecharge";
	}	
	
	/**
	 * 流量充值时根据手机号查询号段、流量包
	 * */
	@GetMapping("sectionAndDataPkgGet")
	@ResponseBody
	public String sectionAndDataPkgGet(HttpServletRequest req){
		return dataChargeSer.sectionAndDataPkgGet(req);
	}
	
	/**
	 * 检测手机号有关信息,返回给页面显示
	 * 
	 */
	@PostMapping("dataChargeBatchCheckPhone")
	@ResponseBody
	public String batchCheckPhone(HttpServletRequest req){
		return dataChargeSer.batchCheckPhone(req);
	}
}
